package com.weixin.tool;

import com.weixin.po.UserInfo;

public class WeixinTool {

	private String userInfoUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID";
	private String openid = "";
	
	public UserInfo getUserInfo(String accessToken){
		String result = HttpTool.doGet(userInfoUrl.replaceAll("ACCESS_TOKEN", accessToken).replaceAll("OPENID", openid));
		UserInfo userInfo = GsonFactory.createObjcet(result, UserInfo.class);
		return userInfo;
	}
}
